<?php 
//引入类
// $rootPath= dirname(__FILE__);
require 'PHPMailer.php';
require 'SMTP.php';

//实例化类
$mail = new PHPMailer;

$mail->isSMTP();                                          // Set mailer to use SMTP
$mail->Host = 'smtp.qq.com';                             // Specify main and backup SMTP servers
$mail->SMTPAuth = true;                                   // Enable SMTP authentication
$mail->Username = '1469984861@qq.com';                  // SMTP username
$mail->Password = 'uchanxcuiswridgj';                        // SMTP password
$mail->CharSet = 'UTF-8';

$mail->setFrom('1469984861@qq.com', '一叶飘零');
$mail->addAddress('zhanglibin@huatu.com', '盆友你好');             // Add a recipient
$mail->addReplyTo('1469984861@qq.com', 'qq');

$mail->isHTML(true);                                      // Set email format to HTML

$mail->Subject = '我不是一个广告那么简单,我是...'; // 标题的名字
$mail->msgHTML(file_get_contents('content.html'));

if(!$mail->send()) {
    echo 'Message could not be sent.';
    echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
    echo 'Message has been sent';
}
?>